<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/axios.min.js"></script>
</head>
<body>
<script>
    axios.get('http://localhost:3000/adata')
    .then(ret=>{
        console.log(ret)
        console.log(ret.data)
    })
    axios.get('http://localhost:3000/axios/123')
    .then(ret=>{
        console.log(ret)
        console.log(ret.data)
    })
    axios.get('http://localhost:3000/axios?id=456')
    .then(ret=>{
        console.log(ret)
        console.log(ret.data)
    })
    axios.get('http://localhost:3000/axios',{
        params:{
            id:123
        }
    })
    .then(ret=>{
        console.log(ret.data)
    })
    axios.delete('http://localhost:3000/axios/999')
    .then(ret=>{
        console.log(ret.data)
    })
    axios.delete('http://localhost:3000/axios?id=586')
    .then(ret=>{
        console.log(ret.data)
    })
    axios.delete('http://localhost:3000/axios',{
        params: {
            id:8888888
        }
    })
    .then(ret=>{
        console.log(ret.data)
    })
    axios.post('http://localhost:3000/axios',{
        uname:'lisi',
        pwd:123
    })
    .then(ret=>{
        console.log(ret.data)
    })

    var params=new URLSearchParams()
    params.append('uname','zhangsan')
    params.append('pwd','123456')
    axios.post('http://localhost:3000/axios',params)
    .then(ret=>{
        console.log(ret)
    })

    axios.put('http://localhost:3000/axios/123',{
        uname:'lisi',
        pwd:123456789
    })
    .then(res=>{
        console.log(res.data)
    })

    axios.get('http://localhost:3000/axios-json')
    .then(ret=>{
        console.log(ret.data)
    })
</script>
</body>
</html>
